﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Permissions;

namespace CivilleWebRole.App_code
{
    [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
    public class UserParameter : System.Web.UI.WebControls.Parameter
    {
        protected override object Evaluate(HttpContext context, System.Web.UI.Control control)
        {
            if (context.User != null && !string.IsNullOrEmpty(context.User.Identity.Name))
            {
                return context.User.Identity.Name;
            }
            return null;
        }
    }
}